#ifndef GEN_H
#define GEN_H

#include "pari-python.h"

struct PyGEN {
	PyObject_HEAD
	
	GEN val; //this value must be on the heap (always use gclone)
};

PyGEN* create_gen(GEN initVal);
void gen_dealloc(PyObject* _self);

void wrong_parameter(const char* required, PyObject* obj);

GEN genFromLong(PyObject* obj);
GEN gen_cast(PyObject* obj);

GEN gen_item_gen(GEN val, Py_ssize_t n);
Py_ssize_t gen_len_gen(GEN val);

extern PyTypeObject pari_GEN;
extern PyNumberMethods gen_as_number;
extern PySequenceMethods gen_as_sequence;
extern PyMethodDef core_methods[];

PyObject* gs_div_behavior(PyObject*, PyObject* args) ;
#endif
